home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / CSMP Digest / volume 1 / csmp-v1-115.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  43.3 KB  |  1,100 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Tue, 16 Jun 92       Volume 1 : Issue 115
  2.  
  3. Today's Topics:
  4.  
  5.     More user input to applications
  6.     Lasguage Systems Fortran & Quadra
  7.     Menu
  8.     how good is MacApp?
  9.     Off-screen Port Help & Interface Guidelines Question...
  10.     3d graphics programming
  11.     Trouble with resumeCmd (Sound Manager)
  12.     preloaded and purgable resources (Q)
  13.     'STR ' resource question
  14.     How to swab two bytes?
  15.  
  16.  
  17. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  18.  
  19. These digests are available (by using FTP, account anonymous, your email
  20. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  21. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  22. Questions list.  The last several issues of the digest are available from
  23. sumex-aim.stanford.edu as well.
  24.  
  25. These digests are also available via email.  Just send a note saying that you
  26. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  27. automatically receive each new digest as it is created.
  28.  
  29. The digest is a collection of articles from the internet newsgroup comp.sys.
  30. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  31. and want an archive of the discussions.  If you don't know what a newsgroup
  32. is, you probably don't have access to it.  Ask your systems administrator(s)
  33. for details.  (This means you can't post questions to the digest.)
  34.  
  35. The articles in these digests are taken directly from comp.sys.mac.programmer.
  36. They are not edited; all articles included in this digest are in their original
  37. posted form.  The only articles that are -not- included in these digests are
  38. those which didn't receive any replies (except those that give information
  39. rather than ask a question).  All replies to each article are concatenated
  40. onto the original article in the order in which they were received.  Article
  41. threads are not added to the digests until the last article added to the
  42. thread is at least one month old (this is to ensure that the thread is dead
  43. before adding it to the digests).
  44.  
  45. Send administrative mail to mkelly@cs.uoregon.edu.
  46.  
  47. -------------------------------------------------------
  48.  
  49. From: hugh@rschp1.anu.edu.au (Hugh Fisher)
  50. Subject: More user input to applications
  51. Organization: Research School of Chemistry, ANU
  52. Date: Sun, 10 May 92 23:43:39 GMT
  53.  
  54.   About a month ago I brought my Macintosh, complete
  55.   with Talking Moose, into the office to do some work
  56.   (and to try and make some converts from IBM PCs).
  57.   The moose made quite an impression on passer-bys
  58.   while I was elsewhere, until someone nervously
  59.   asked me "That thing doesn't know when somebody
  60.   walks past, does it?" I reassured them it was just
  61.   coincidence, but now I'm wondering whether the
  62.   computer should know when you're around?
  63.  
  64.   An example in "TOG on Interface" is that of choosing
  65.   to print a 75 page document, then going home without
  66.   remembering to click OK on the dialog. Tog suggested
  67.   a time out, but if the computer had an eye tracker,
  68.   small CCD camera, or even a pressure sensitive seat
  69.   cushion it could shout "Hey, come back!" instead.
  70.  
  71.   So, should our Macintoshes get cameras, datagloves,
  72.   eye trackers, ... neural interfaces? As a techie
  73.   I like that sort of thing, but would the general
  74.   reaction be more like that to my moose instead?
  75.  
  76.     Hugh Fisher
  77.     hugh@rschp1.anu.edu.au
  78.  
  79. +++++++++++++++++++++++++++
  80.  
  81. From: rmh@taligent.com (Rick Holzgrafe)
  82. Date: 14 May 92 22:51:59 GMT
  83. Organization: Taligent, Inc.
  84.  
  85. In article <1992May10.234339.23717@newshost.anu.edu.au>, hugh@rschp1.anu.edu.au
  86. (Hugh Fisher) writes:
  87. >   An example in "TOG on Interface" is that of choosing
  88. >   to print a 75 page document, then going home without
  89. >   remembering to click OK on the dialog. Tog suggested
  90. >   a time out, but if the computer had an eye tracker,
  91. >   small CCD camera, or even a pressure sensitive seat
  92. >   cushion it could shout "Hey, come back!" instead.
  93.  
  94. Turn it around: I want a computer that doesn't need all
  95. that hardware because I've always got it with me. In my
  96. dreams, I own a computer that unfolds like a newspaper
  97. (not one of these tiny-screened, massive PowerBooks :-)
  98. and which I can simply keep tucked in a pocket. It
  99. networks automatically via infrared (or something) and
  100. is run by my finger or a pen, no keyboard. If I forget
  101. to click "OK", I can remember at any later time and it'll
  102. print on the next available printer. And since it's
  103. always with me, it can just cough discreetly if it thinks
  104. I've forgotten to do something important, like clicking
  105. that button.
  106.  
  107. Yeah, I know. "In my dreams."
  108.  
  109. >     Hugh Fisher
  110. >     hugh@rschp1.anu.edu.au
  111.  
  112. - -- Rick Holzgrafe, a member of the Taligentsia
  113.    Rick_Holzgrafe@taligent.com
  114.    rmh@taligent.com
  115.  
  116. +++++++++++++++++++++++++++
  117.  
  118. From: ephraim@think.com (Ephraim Vishniac)
  119. Date: 15 May 92 13:57:31 GMT
  120. Organization: Thinking Machines Corporation, Cambridge MA, USA
  121.  
  122. In article <67144@apple.Apple.COM> rmh@taligent.com (Rick Holzgrafe) writes:
  123. >Turn it around: I want a computer that doesn't need all
  124. >that hardware because I've always got it with me. In my
  125. >dreams, I own a computer that unfolds like a newspaper
  126. >(not one of these tiny-screened, massive PowerBooks :-)
  127. >and which I can simply keep tucked in a pocket. It
  128. >networks automatically via infrared (or something) and
  129. >is run by my finger or a pen, no keyboard. If I forget
  130. >to click "OK", I can remember at any later time and it'll
  131. >print on the next available printer. And since it's
  132. >always with me, it can just cough discreetly if it thinks
  133. >I've forgotten to do something important, like clicking
  134. >that button.
  135.  
  136. >Yeah, I know. "In my dreams."
  137.  
  138. Some dreams are coming true. 
  139.  
  140. Back when the only kinds of Mac were "skinny" and "fat," someone
  141. posted an article to net.micro.mac describing a dream he'd had. In his
  142. dream, he was working with his full-color Mac (this was late '84,
  143. probably) early in the morning when the Mac told him it was time for
  144. breakfast. But it didn't pop up an alert, or say "It's time for
  145. breakfast." or anything so mundane.  It showed him a sort of
  146. advertisement for breakfast, with a moving aerial view of sunrise over
  147. rolling green hills. 
  148.  
  149. Now we've got color, the Notification Manager, AppleEvents, and
  150. Quicktime. Anybody want to take a stab at prototyping the Breakfast
  151. Alert Dream? 
  152.  
  153. - -- 
  154. Ephraim Vishniac    ephraim@think.com   ThinkingCorp@applelink.apple.com
  155.  Thinking Machines Corporation / 245 First Street / Cambridge, MA 02142
  156.         One of the flaws in the anarchic bopper society was
  157.         the ease with which such crazed rumors could spread.
  158.  
  159. ---------------------------
  160.  
  161. From: majamu@uta.fi (Jari Multisilta)
  162. Subject: Lasguage Systems Fortran & Quadra
  163. Date: 15 May 92 11:24:41 GMT
  164. Organization: University of Tampere, Finland
  165.  
  166. Hello
  167.  
  168. Does anybody know how to compile fortran code for Mac Quadra by
  169. using Language Systems Fortran 2.1?
  170.  
  171. Our old fortran applications won't run because they require 68020 and
  172. 68881 processors (the Quoadra don't have one).
  173.  
  174. I have tried to link  with NoChipCheck.o library but it generates
  175. mysteroius errors (out of memory!) in for example in fx.
  176.  
  177. Thanks,
  178.  
  179.        Jari Multisilta, researcher
  180.        Tampere univ. of tech., dept. of math.
  181.  
  182. +++++++++++++++++++++++++++
  183.  
  184. From: holiday@bnr.ca
  185. Date: 15 May 92 14:21:29 GMT
  186. Organization: Bell-Northern Research
  187.  
  188. In article <5747@kielo.uta.fi>, majamu@uta.fi (Jari Multisilta) writes:
  189. |> Hello
  190. |> 
  191. |> Does anybody know how to compile fortran code for Mac Quadra by
  192. |> using Language Systems Fortran 2.1?
  193. |> 
  194. |> Our old fortran applications won't run because they require 68020 and
  195. |> 68881 processors (the Quoadra don't have one).
  196. |> 
  197. |> I have tried to link  with NoChipCheck.o library but it generates
  198. |> mysteroius errors (out of memory!) in for example in fx.
  199. |> 
  200. |> Thanks,
  201. |> 
  202. |>        Jari Multisilta, researcher
  203. |>        Tampere univ. of tech., dept. of math.
  204.  
  205. You probably need to upgrade to LS FORTRAN 3.0, which handles 68040
  206. machines.
  207.  
  208. - ---------------------------------------------------------------------------
  209. Matt Holiday                                      #include <std/disclaimer>
  210. holiday@bnr.ca
  211. BNR Richardson
  212.  
  213. ---------------------------
  214.  
  215. From: sjones@cygnusx1.cs.utk.edu (Stephen Jones)
  216. Subject: Menu
  217. Date: 15 May 92 14:20:28 GMT
  218. Organization: University of Tennessee, Knoxville
  219.  
  220. Has anyone had any experience with placing multiple identical
  221. hierarchical menus dynamically into a menu ?  The problem I am having is
  222. finding out which menu has been selected ( since I create them all from
  223. the same resource and their resource ID is returned upon selection ).
  224.  
  225.   As I see it my options are :
  226. 1. Limit the number of H. menus available by making a seperate identical
  227. resource ( different ID #s )for each one ( I'm trying this but my code
  228. will not work, it displays the menu name but not the H. menu ) ???
  229.  
  230. 2. Copy the old resource, get a unique ID, and insert the resource. (
  231. This just seems like to much of a hassle )
  232.  
  233.     Thanks for any help/opinions anyone has to offer.
  234.  
  235.                 Stephen Jones
  236.  
  237. +++++++++++++++++++++++++++
  238.  
  239. From: jcav@quads.uchicago.edu (JohnC)
  240. Date: Fri, 15 May 1992 15:07:58 GMT
  241. Organization: The Royal Society for Putting Things on Top of Other Things
  242.  
  243. In article <l17i5cINN4o9@utkcs2.cs.utk.edu> sjones@cygnusx1.cs.utk.edu (Stephen Jones) writes:
  244. >Has anyone had any experience with placing multiple identical
  245. >hierarchical menus dynamically into a menu ?  The problem I am having is
  246. >finding out which menu has been selected ( since I create them all from
  247. >the same resource and their resource ID is returned upon selection ).
  248.  
  249. You've run into one of the gotchas of menus.  (and there are so many)
  250. Unlike, for example, WIND and CNTL resources, a MENU resource is not a
  251. simple template.  Rather, it is the actual menu data structure itself.  The
  252. object that gets inserted into the system menu list is the actual resource
  253. handle, not a copy.
  254.  
  255. >  As I see it my options are :
  256. >1. Limit the number of H. menus available by making a seperate identical
  257. >resource ( different ID #s )for each one ( I'm trying this but my code
  258. >will not work, it displays the menu name but not the H. menu ) ???
  259.  
  260. You must make sure that the "parent" item contains the correct menu ID for
  261. its sub-menu.  You can change this on the fly use _SetItemMark.  Note that
  262. you must type-cast the menu ID to CHAR in order to make _SetItemMark happy.
  263.  
  264. >2. Copy the old resource, get a unique ID, and insert the resource. (
  265. >This just seems like too much of a hassle )
  266.  
  267. There's no real alternative, unfortunately.  You could clone the resource
  268. handle and then try to manually duplicate what _GetMenu/_NewMenu do to
  269. initalize the data-structure, but Compatability Hell awaits those who
  270. attempt such things.  :-)   Of course, all of this would be very easy if
  271. there were an _InitializeMenuHandle function.  Oh well.
  272.  
  273. - -- 
  274. John Cavallino                  |  EMail: jcav@midway.uchicago.edu
  275. University of Chicago Hospitals |         John_Cavallino@uchfm.bsd.uchicago.edu
  276. Office of Facilities Management | USMail: 5841 S. Maryland Ave, MC 0953
  277. B0 f++ c+ g+ k s++ e+ h- pv     |         Chicago, IL  60637
  278.  
  279. +++++++++++++++++++++++++++
  280.  
  281. From: dorner@pequod.cso.uiuc.edu (Steve Dorner)
  282. Organization: University of Illinois at Urbana-Champaign
  283. Date: Fri, 15 May 1992 18:10:33 GMT
  284.  
  285. sjones@cygnusx1.cs.utk.edu (Stephen Jones) writes:
  286. >Has anyone had any experience with placing multiple identical
  287. >hierarchical menus dynamically into a menu ?  The problem I am having is
  288. >finding out which menu has been selected ( since I create them all from
  289. >the same resource and their resource ID is returned upon selection ).
  290.  
  291. There _menu_ id is returned on selection.  There's a big difference between
  292. a menu id and a resource id.  You're right that you can't tell which
  293. one was selected (sigh).
  294.  
  295. Here's what Eudora does, minus a few oddities and error checking:
  296.  
  297.   savedMHandle = NewMenu(NEW_TO_HIER_MENU,"");
  298.   for (menu=NEW_TO_HIER_MENU;menu<=INSERT_TO_HIER_MENU;menu++)
  299.   {
  300.     mHandle = savedMHandle;
  301.     if (menu>NEW_TO_HIER_MENU) HandToHand(&mHandle);
  302.     (*mHandle)->menuID=menu;
  303.     InsertMenu(mHandle,-1);
  304.   }
  305.  
  306. Note that it does NOT create a resource for every menu; it just dups the
  307. handle and stuffs in a new menu id.  Seems to work.
  308. - -- 
  309. Steve Dorner, U of Illinois Computing Services Office
  310. Internet: s-dorner@uiuc.edu  UUCP: uunet!uiucuxc!uiuc.edu!s-dorner
  311.  
  312. ---------------------------
  313.  
  314. From: ttulinsk@netcom.com (Tom Tulinsky)
  315. Subject: how good is MacApp?
  316. Date: Tue, 12 May 92 01:11:12 GMT
  317. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  318.  
  319. We are trying to decide whether to use MacApp or Open Interface, a platform 
  320. independent GUI that runs on Mac, Windows, and XWindows.  Portability is one 
  321. of our goals but if MacApp would make the application a lot faster to 
  322. develop, we could go with it.  
  323.  
  324. Application: Electronic publishing; positioning ads in a magazine.  Requires:
  325. - - pulldown menus, dialog boxes, text edit and pushbuttons
  326. - - scrolling lists
  327. - - dragging of objects (ads) by mouse
  328. - - drawing text and scanned images to depict magazine in a scrolled window
  329.  
  330. We are very small and have a short time schedule so ease of use is paramount. 
  331. We are new to the Mac but experienced in C++, Motif, and Unix.
  332.  
  333. What is Open Interface, you ask? Its from Neuron Data in Palo Alto.  It seems 
  334. like Motif, but with somewhat less functionality.  It has an interactive 
  335. screen layout editor.  Its graphics are primitive and have no support 
  336. for images. You can escape to write platform specific code if it can't 
  337. do something.  
  338.  
  339. - - How much better is MacApp than, say, Motif ?
  340. - - How much would it help to read and display scanned images ?
  341. - - Are there other advantages to using it ?
  342.  
  343.  
  344.  
  345. +++++++++++++++++++++++++++
  346.  
  347. From: peirce@outpost.SF-Bay.org (Michael Peirce)
  348. Date: 12 May 92 15:10:43 GMT
  349. Organization: Peirce Software
  350.  
  351.  
  352. In article <vflks6+.ttulinsk@netcom.com> (comp.sys.mac.programmer), ttulinsk@netcom.com (Tom Tulinsky) writes:
  353. > We are trying to decide whether to use MacApp or Open Interface, a platform 
  354. > independent GUI that runs on Mac, Windows, and XWindows.  Portability is one 
  355. > of our goals but if MacApp would make the application a lot faster to 
  356. > develop, we could go with it.  
  357.  
  358. At the Apple World Wide Developer's Conference this week Apple has
  359. been hinting heavily that MacApp will go multiplatform.  They really
  360. won't say, but they've repeatedly said to watch for a big announcement
  361. at the upcoming PC Expo.
  362.  
  363. - --  Michael Peirce         --   peirce@outpost.SF-Bay.org
  364. - --  Peirce Software        --   Suite 301, 719 Hibiscus Place
  365. - --  Macintosh Programming  --   San Jose, California USA 95117
  366. - --           & Consulting  --   voice: (408) 244-6554 fax: (408) 244-6882
  367. - --                         --   AppleLink: peirce & America Online: AFC Peirce
  368.  
  369. +++++++++++++++++++++++++++
  370.  
  371. From: eric_berdahl@taligent.com (Eric Berdahl)
  372. Date: 12 May 92 18:44:00 GMT
  373. Organization: Taligent, Inc.
  374.  
  375. Tom,
  376.  
  377. Preface all this with "I don't program Motif, and I don't know much about Open
  378. Interface, but..."
  379.  
  380. MacApp is much more than a GUI.  In fact, MacApp doesn't really provide a GUI at
  381. all, it just organizes the standard Macintosh UI elements into an
  382. object-oriented framework.  MacApp has a number of tools that allow easy
  383. composition of a UI layout.
  384.  
  385. But MacApp is much more than that.  MacApp is a class library for the
  386. construction of Macintosh programs (if cross-platform compatibility is really
  387. important, MacApp is _not_ your solution).  It provides a framework for doing
  388. object-oriented appication development, with support for many of the various
  389. areas common to Mac applications: a hierarchical view system, event handling, a
  390. document metaphor, excellent memory management (truly, one of the biggest wins
  391. of MacApp), elegant exception handling (neck and neck with memory management for
  392. importance), and more.  Like any solution, it has its warts, but it truly is a
  393. great way to develop applications (or quickly prototype) on a Mac.
  394.  
  395. For the things you listed, there is explicit support for the UI elements you
  396. listed.  Dragging objects via mouse tracking is supported by a framework to do
  397. mouse tracking.  To do it right, you would need to do some coding to handle the
  398. specifics of your dragging, but the framework makes this relatively easy. 
  399. Drawing scanned images is a specific TView subclass that you would have to write
  400. or get from someone (may I suggest the TGWorldView class from FotoApp, available
  401. on E.T.O. #5).
  402.  
  403. As for reading scanned images, MacApp does provide a framework for reading files
  404. whereby you only write the code to actually pull the bytes out of the file and
  405. put them into your data structures.  This allows you to completely forget the
  406. Mac File Manager and all its weird requirements.
  407.  
  408. Hope this helps.
  409.  
  410. - --
  411. Eric Berdahl                                 MADA President
  412. Internet: eric_berdahl@taligent.com          AppleLink: BERDAHL
  413. #include <StdDisclaimer.h>
  414. This is a freeware signature.  What do you expect for nothing?
  415.  
  416. +++++++++++++++++++++++++++
  417.  
  418. From: orpheus@reed.edu (P. Hawthorne)
  419. Date: 15 May 92 02:33:57 GMT
  420. Organization: Reed College, Portland OR
  421.  
  422.  
  423.   eric_berdahl@taligent.com (Eric Berdahl) writes:
  424. : MacApp is a class library for the construction of Macintosh programs....
  425. : It provides a framework for doing object-oriented appication development,
  426. : with support for many of the various areas common to Mac applications: a
  427. : hierarchical view system, event handling, a document metaphor, excellent
  428. : memory management (truly, one of the biggest wins of MacApp), elegant
  429. : exception handling (neck and neck with memory management for importance),
  430. : and more.  Like any solution, it has its warts, but it truly is a great
  431. : way to develop applications (or quickly prototype) on a Mac.
  432.  
  433.   The warts mentioned above are quite understandable, ultimately. Aside
  434.   from the significant delays I have come to expect from using MacApp
  435.   applications in the real world, I am awestruck by the sophistication of
  436.   the environments provided by them. PhotoShop and StrataVision are some
  437.   of the most impressive applications I have ever seen, no matter how
  438.   long they take to start up. The nuts and bolts of the memory management
  439.   and exception handling reveal some radical devotion to doing things the
  440.   right way, if not with an overt emphasis on speed.
  441.  
  442.   Still, I would prefer applications that come up without a very long
  443.   delay, a stable memory space when the application is doing real work, a
  444.   transparent means of using temporary memory for the bulk of open
  445.   document and world memory usage, application heap sizes of 64k or so,
  446.   an instantiated object browser within the application during testing,
  447.   garbage collection and heap defragmentation that takes place
  448.   incrementally at idle time, memory leak detection and identification,
  449.   and an exception handling unit with a setjmp and longjmp that would get
  450.   along with the debugging environment in Think Pascal.
  451.  
  452.   Everybody has their dreams, which we must pursue for ourselves...
  453.  
  454.   Theus (orpheus@reed.edu)
  455.  
  456. ---------------------------
  457.  
  458. From: jcav@quads.uchicago.edu (JohnC)
  459. Subject: Off-screen Port Help & Interface Guidelines Question...
  460. Date: 14 May 92 00:51:39 GMT
  461. Organization: The Royal Society for Putting Things on Top of Other Things
  462.  
  463. In article <35267@darkstar.ucsc.edu> speth@cats.ucsc.edu (James Gustave) writes:
  464. >
  465. >I have two questions, the first is an aesthetic question about the interface,
  466. >the second is a technical question about using offscreen ports.
  467. >
  468. >First, I'm writing a program that displays incoming serial data from a
  469. >PowerGlove.  I'd like to have multiple windows open, each showing the
  470. >data in a different format.  It looks odd to have a window in the
  471. >background being drawn to, does that follow the interface standards?
  472. >Is there a better way to do it?
  473.  
  474. There's nothing wrong with drawing into a window while your application is
  475. not in front.
  476.  
  477. >Second, (and more importantly), I'm drawing the data first to an offscreen
  478. >port then copying the bits to the windows, to reduce flicker.  This works fine,
  479. >but it will overwrite anything that may be in front of the window, such as
  480. >another window or even a screen saver.  Is there some way to test to see how
  481. >much of the window is visible and only copy the bits into that area?  Is there
  482. >another solution?
  483.  
  484. You must make absolutely sure that the grafPort (window) to which the
  485. destination bitmap is attached is the current grafport (using _SetPort).  If
  486. this is true, then _CopyBits will honor the grafPort's visRgn and clipRgn,
  487. and thus not smash screen areas that are off-limits.  The documentation for
  488. _CopyBits in IM-I mentions this fact.  If, for some unlikely reason, you
  489. can't have the window be the current port, you can always tell _CopyBits the
  490. legal drawing area manually via the maskRgn parameter.
  491.  
  492.  
  493. - -- 
  494. John Cavallino                  |  EMail: jcav@midway.uchicago.edu
  495. University of Chicago Hospitals |         John_Cavallino@uchfm.bsd.uchicago.edu
  496. Office of Facilities Management | USMail: 5841 S. Maryland Ave, MC 0953
  497. B0 f++ c+ g+ k s++ e+ h- pv     |         Chicago, IL  60637
  498.  
  499. +++++++++++++++++++++++++++
  500.  
  501. From: speth@cats.ucsc.edu (James Gustave)
  502. Date: 14 May 92 03:36:30 GMT
  503. Organization: University of California, Santa Cruz
  504.  
  505.  
  506. Thanks!  The two replies I got were sufficient to solve my problem.
  507. The program now works beautifully (at least I think so :)
  508.  
  509. - -- 
  510. Jim Speth
  511. speth@cats.ucsc.edu
  512.  
  513. ---------------------------
  514.  
  515. From: lamont@ux1.cso.uiuc.edu (Bradley Lamont)
  516. Subject: 3d graphics programming
  517. Date: 11 May 92 03:14:47 GMT
  518. Organization: University of Illinois at Urbana
  519.  
  520. What abilities does the Mac have as far as 3d graphics are concerned?  I am
  521. interested in porting a program I wrote on a SGI machine to the mac.
  522.  
  523. I need a way to set RGB colors, draw solid polygons, and map a 3d space
  524. onto a 2d screen (i.e. viewing transformation).
  525.  
  526. I noticed in Think C that the libraries have a file called Graf3D which
  527. has something called a GrafPort3D.  But I can't seem to find anything about
  528. this in Inside Mac (vol 1-6).  Does apple not really support 3d color
  529. graphics?
  530.  
  531. Please respond via email since I don't read this group regularly.
  532.  
  533. Thanks, 
  534. Brad
  535.  
  536. - -- 
  537. /----------------------------------------------------------------------------\
  538. |          Bradley H. Lamont          |  The University of Illinois          |
  539. |       lamont@ux1.cso.uiuc.edu       |                at Urbana/Champaign   |
  540. \----------------------------------------------------------------------------/
  541.  
  542. +++++++++++++++++++++++++++
  543.  
  544. From: rae@alias.com (Reid Ellis)
  545. Organization: Alias Research, Inc., Toronto ON Canada
  546. Date: Tue, 12 May 1992 01:17:48 GMT
  547.  
  548. [Warning: I work for Alias, and helped write Alias Sketch!, so I may
  549.  be a bit less than purely objective when it comes to the relative
  550.  importance of 3D in the marketplace.. :-)]
  551.  
  552. Bradley Lamont <lamont@ux1.cso.uiuc.edu> writes:
  553. |What abilities does the Mac have as far as 3d graphics are concerned?  I am
  554. |interested in porting a program I wrote on a SGI machine to the mac.
  555.  
  556. You won't see anything approaching the GL library on the Mac.  The
  557. closest thing is what you've already found, Graf3D, which is pretty
  558. much a joke nowadays.
  559.  
  560. I think there are some third-party libraries out there.  Maybe someone
  561. can comment?
  562.  
  563. |Does apple not really support 3d color
  564. |graphics?
  565.  
  566. Got it in one.  What with the increasing prevalance of 3D software and
  567. the need for 3D geometry to be handled as easily as 2D [PICT], I think
  568. that Apple would be missing a rich market opportunity if they didn't
  569. address this.
  570.  
  571. Reid
  572. - --
  573. Reid Ellis                                            
  574. rae@utcs.utoronto.ca        ||           rae@Alias.com
  575. CDA0610@applelink.apple.com ||  +1 416 362 9181 [work]
  576.  
  577. +++++++++++++++++++++++++++
  578.  
  579. From: akhiani@ricks.enet.dec.com (Homayoon Akhiani)
  580. Date: 12 May 92 22:21:08 GMT
  581. Organization: Digital Equipment Corporation
  582.  
  583.  
  584.  The following is a best port I ever saw of SGI GL.  They have drivers for 
  585.  almost everything, except MAC. The speed of the drivers are also very impressive
  586.  I have look at their source code, it looks easy to write a driver for MAC.
  587.  I am new to MAC world, hopefully someone with great exprience will low level
  588.  QuickDraw should be able to port the driver else I will eventually do it.
  589.  
  590.  
  591. ======================
  592.     
  593. Article: 19441
  594. From: echidna@ecr.mu.oz.au (Eric H. Echidna)
  595. Newsgroups: comp.graphics
  596. Subject: VOGL - yet another SGI GL like graphics library.
  597. Date: 14 Jun 91 07:37:49 GMT
  598. Sender: news@cs.mu.OZ.AU
  599. Organization: Comp Sci, University of Melbourne, Australia
  600.  
  601. Recently it came to our attention that someone might have 
  602. attempted developing an SGI GL compatible library using an early
  603. version of VOGLE, and while not only giving very little credit to the
  604. large amount of VOGLE code contained in it, even suggesting that VOGLE
  605. was derivative work.
  606.  
  607. While we hope that any rumor concerning people grossly misrepresenting
  608. work which was done by us will prove to be untrue (and this will be looked
  609. into), it did seem like an interesting idea to find out how difficult it
  610. would be to convert VOGLE to an SGI GL compatible library. As it turned out it
  611. took about 60 marsupial hours spread over a period of four weeks to do it.
  612.  
  613. Although there are several SGI GL compatible libraries already
  614. available, we believe this to be the only one that provides some
  615. support for things like double buffering and backfacing, as well as
  616. running on a variety of PC's in addition to X11, sunview, etc...
  617. Consequently we have decided to make the result of our efforts (now
  618. called VOGL) available and we would like to offer it as an example
  619. of what can be done when the people who did the original work on one
  620. problem address another problem of a similar nature, using the original
  621. work, and their understanding of it, as the basis for finding a
  622. solution. If there is sufficient interest, we will try to ensure
  623. that bugs, enhancements, etc... are dealt with as they are sent to us.
  624. The README is attached below.
  625.  
  626. We have also included a hershey library which is written in SGI GL, but
  627. will also run with VOGL.
  628.  
  629. It is available via anonymous ftp from:
  630.  
  631.         gondwana.ecr.mu.oz.au:pub/vogl.tar.Z    [128.250.1.63]  
  632.  
  633. - ---------------------cut here------------------cut here-----------------
  634.  
  635. The directories in this directory contain the source for the VOGL library
  636. and the library hershey which is for manipulating the Hershey font data.
  637.  
  638. They are as follows:
  639.  
  640.     docs        contains the documentation such as there is.
  641.  
  642.     drivers        contains the source to a variety of device drivers,
  643.             currently restricted to: postcript, sun workstation, 
  644.             apollo workstations, X11 (R2, R3 & R4), tektronix 
  645.             (401x), hpgl, dxy, and the ibm pc cards: hercules mono,
  646.             cga, ega, vga and sigma.
  647.  
  648.     examples    contains some C and FORTRAN programs useful both in
  649.             testing and (hopefully) learning how to use it.
  650.  
  651.     hershey        contains the source for the hershey library plus the
  652.             source for generating fonts and the hershey data for
  653.             the occidental and oriental character sets. Note: as
  654.             with VOGL this library is callable in C and FORTRAN.
  655.  
  656.     src        contains the source for the C VOGL interface, and the 
  657.             source for the FORTRAN interfaces where available.
  658.             
  659. VOGL is a device portable graphics library that tries to be Silicon Graphics 
  660. Iris GL compatible. Our intention is that any VOGL program will compile
  661. unchanged on a machine running SGI GL (the examples do). VOGL is based
  662. entirely on our other graphics library VOGLE. While we still regard VOGLE
  663. as our main library (it is, and probably will be for some time to come, the
  664. one that gets the most use around here), we will gratefully accept any bug
  665. fixes or enhancements. As always suggestions are also welcome.
  666.  
  667. This software may be used for any purpose commercial or otherwise. It is
  668. offered without any guarantee as to its suitability for any purpose or as
  669. to the sanity of its writers. We do ask that the source is passed on to
  670. anyone that requests a copy, and that people who get copies don't go round
  671. claiming they wrote it (that is why this one has a copyright notice in it,
  672. see file COPYRIGHT).
  673.  
  674. Although VOGL is free we will drink any quantity of Beer you send to us.
  675.  
  676. Regards,
  677.  
  678.     Eric H. Echidna
  679.  
  680. Snail mail correspondance and alcoholic beverages should be directed to:
  681.  
  682.     The Software Support Programmer
  683.     Department Of Engineering Computer Resources
  684.     Faculty Of Engineering
  685.     University Of Melbourne Vic 3052
  686.     Australia
  687.  
  688. email to 
  689.  
  690.     echidna@munnari.OZ.AU
  691.     echidna@ecr.mu.OZ.AU
  692.     
  693.  
  694.  
  695. - --
  696. - -------------------------------------------------------------------------------
  697. Homayoon Akhiani                               "Turning Ideas into ... Reality"
  698. Digital Equipment Corporation                        "Alpha, The New Beginning"
  699. 77 Reed Rd. Hudson, MA 01701            "All Rights Reserved. Copyright(c)1992"
  700. Email: akhiani@ricks.enet.dec.com     "The words are mine, and not my employer"
  701. - -------------------------------------------------------------------------------
  702.  
  703. +++++++++++++++++++++++++++
  704.  
  705. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  706. Organization: University of Illinois at Urbana
  707. Date: Wed, 13 May 1992 01:02:00 GMT
  708.  
  709. We've got some sort of port of VOGLE done, and our stuff is generally free
  710. (with source code). I say "sort of" because it doesn't do z-buffering, and
  711. that makes it pretty limited right now (can you say "those polygons are being
  712. drawn out of order"?) It's not blazingly fast, either. It's mostly complete,
  713. though. liberte@ncsa.uiuc.edu (Dan LaLiberte) is the one handling it.
  714. - -- 
  715. Mark Lanett, NCSA Software Development - mlanett@uiuc.edu
  716.  
  717. +++++++++++++++++++++++++++
  718.  
  719. From: cfranz@iiic.ethz.ch (Christian Steffen Ove Franz)
  720. Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH)
  721. Date: Wed, 13 May 1992 12:21:54 GMT
  722.  
  723. In article <1992May12.011748.9971@alias.com> rae@alias.com (Reid Ellis) writes:
  724. >Bradley Lamont <lamont@ux1.cso.uiuc.edu> writes:
  725. >|What abilities does the Mac have as far as 3d graphics are concerned?  I am
  726. >|interested in porting a program I wrote on a SGI machine to the mac.
  727. >
  728. >You won't see anything approaching the GL library on the Mac.  The
  729. >closest thing is what you've already found, Graf3D, which is pretty
  730. >much a joke nowadays.
  731. >
  732. >I think there are some third-party libraries out there.  Maybe someone
  733. >can comment?
  734. >
  735.  
  736. Well, if all you need is some simple 3D grafsys that focuses on viewing trans-
  737. formation and leaves the rest to the programmer, you can use the 3D graphics
  738. library I wrote and submitted to sumex-aim a few weeks ago.
  739. It is called 3D GrafSys 1.1 for programmers (the people at sumex-aim changed 
  740. that into 3d-graphics-library I think) and can be found in the 
  741. info-mac/source directory. 
  742.  
  743. Maybe you should check it out to see if it does what you need to do. Compared to PHIGS it is much less sophisticated but still gets the most things done and
  744. has a distinct advantage: it's free.
  745.  
  746. Cheers,
  747. Christian.
  748.  
  749.  
  750.  
  751. - -- 
  752. - -----------------------------------------------------------------------------
  753. Christian S. O. Franz                 |                   cfranz@iiic.ethz.ch
  754. ETH Zuerich, Swizerland               |                     vismgr@rz.ethz.ch
  755.  
  756. ---------------------------
  757.  
  758. From: d6caps@dtek.chalmers.se (Per Bergland)
  759. Subject: Trouble with resumeCmd (Sound Manager)
  760. Date: 28 Apr 92 05:20:41 GMT
  761. Organization: Chalmers University of Technology
  762.  
  763. Very strange! I allocate a sound channel, install a sampled sound as
  764. an instrument, start a song consisting of freqDurationCmds and waitCmds,
  765.  and then send a pauseCmd with SndDoImmediate.
  766. When I a few seconds later send a resumeCmd, the machine crashes in _PrimeTime+
  767. something at a jmp (A0) instruction where A0 contains some weird address like
  768. ADB7BD7F.
  769.  
  770. So what's strange about that, you ask?
  771.  
  772. This only happens when running sys 6!!
  773. Even 6.0.7, which supposedly has the same sound manager as sys 7, doesn't
  774. help.
  775. (Side issue : SndChannelStatus never shows status.scChannelPaused under ANY
  776. system, even for a paused channel)
  777.  
  778. +++++++++++++++++++++++++++
  779.  
  780. From: REEKES@applelink.apple.com (Jim Reekes)
  781. Date: 11 May 92 22:39:44 GMT
  782. Organization: Apple Computer, Inc.
  783.  
  784. In article <11275@chalmers.se>, d6caps@dtek.chalmers.se (Per Bergland) writes:
  785. > Very strange! I allocate a sound channel, install a sampled sound as
  786. > an instrument, start a song consisting of freqDurationCmds and waitCmds,
  787. >  and then send a pauseCmd with SndDoImmediate.
  788. > When I a few seconds later send a resumeCmd, the machine crashes in _PrimeTime+
  789. > something at a jmp (A0) instruction where A0 contains some weird address like
  790. > ADB7BD7F.
  791. > So what's strange about that, you ask?
  792. > This only happens when running sys 6!!
  793. > Even 6.0.7, which supposedly has the same sound manager as sys 7, doesn't
  794. > help.
  795. > (Side issue : SndChannelStatus never shows status.scChannelPaused under ANY
  796. > system, even for a paused channel)
  797.  
  798. It's probably a bug.  You should set the rate to 0.0 if you want to pause
  799. a sampled sound.  Use getRateCmd to get the current rate, save it, and then
  800. set the rate to 0.  Later call rateCmd again but this time with the old
  801. rate.
  802.  
  803.  
  804. - -----------------------------------------------------------------------
  805. Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
  806.                              |          Sound Manager Expert
  807. Apple Computer, Inc.         | "All opinions expressed are mine, and do
  808. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  809. Cupertino, CA 95014          |       employer, Apple Computer Inc."
  810.  
  811. +++++++++++++++++++++++++++
  812.  
  813. From: REEKES@applelink.apple.com (Jim Reekes)
  814. Date: 11 May 92 22:40:26 GMT
  815. Organization: Apple Computer, Inc.
  816.  
  817. In article <11275@chalmers.se>, d6caps@dtek.chalmers.se (Per Bergland) writes:
  818. > Very strange! I allocate a sound channel, install a sampled sound as
  819. > an instrument, start a song consisting of freqDurationCmds and waitCmds,
  820. >  and then send a pauseCmd with SndDoImmediate.
  821. > When I a few seconds later send a resumeCmd, the machine crashes in _PrimeTime+
  822. > something at a jmp (A0) instruction where A0 contains some weird address like
  823. > ADB7BD7F.
  824. > So what's strange about that, you ask?
  825. > This only happens when running sys 6!!
  826. > Even 6.0.7, which supposedly has the same sound manager as sys 7, doesn't
  827. > help.
  828. > (Side issue : SndChannelStatus never shows status.scChannelPaused under ANY
  829. > system, even for a paused channel)
  830.  
  831. It's probably a bug.  You should set the rate to 0.0 if you want to pause
  832. a sampled sound.  Use getRateCmd to get the current rate, save it, and then
  833. set the rate to 0.  Later call rateCmd again but this time with the old
  834. rate.
  835.  
  836.  
  837. - -----------------------------------------------------------------------
  838. Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
  839.                              |          Sound Manager Expert
  840. Apple Computer, Inc.         | "All opinions expressed are mine, and do
  841. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  842. Cupertino, CA 95014          |       employer, Apple Computer Inc."
  843.  
  844. ---------------------------
  845.  
  846. From: cconstantine@galaxy.gov.bc.ca
  847. Subject: preloaded and purgable resources (Q)
  848. Date: 29 Apr 92 22:19:23 GMT
  849. Organization: BC Systems Corporation
  850.  
  851. I don't know if this is an FAQ (I don't think it is) but I was wandering
  852. how much I would benefit from PreLoaded resources.  
  853.  
  854. For example: I have some PICT resources and some CURS resources that I usually
  855. have set to "pugeable" for memory reasons.  This was recomended by
  856. someone/where I read.  anyway, in a program where you access these resources
  857. through resource ID's, do the routines access the resource fork anyway, thus
  858. bypassing the fact that they _may_ be 'preloaded' or do they check if they are
  859. in memory first?
  860.  
  861. Also, if you have 'preload'd resources, shoud you also have the purgeable flag
  862. set or is this stupid??
  863.  
  864. I hope I'm clear enough on this.  Any help is muchly appreciated!!
  865.  
  866. - -- 
  867. Carl.Constantine@BCSystems.gov.bc.ca
  868.     or
  869. CCONSTANTINE@galaxy.gov.bc.ca
  870. Victoria, British Columbia, Canada
  871.  
  872. +++++++++++++++++++++++++++
  873.  
  874. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  875. Date: 29 Apr 92 23:48:51 GMT
  876. Organization: Kalamazoo College
  877.  
  878. cconstantine@galaxy.gov.bc.ca writes:
  879. > I was wandering
  880. >how much I would benefit from PreLoaded resources.  
  881. >
  882. >For example: I have some PICT resources and some CURS resources that I usually
  883. >have set to "pugeable" for memory reasons.  This was recomended by
  884. >someone/where I read.  anyway, in a program where you access these resources
  885. >through resource ID's, do the routines access the resource fork anyway, thus
  886. >bypassing the fact that they _may_ be 'preloaded' or do they check if they are
  887. >in memory first?
  888. >
  889. >Also, if you have 'preload'd resources, shoud you also have the purgeable flag
  890. >set or is this stupid??
  891.  
  892. The 'preload' flag is a quick'n'easy way of getting those resources into
  893. memory without calling GetResource().  Additionally, it guarantees that
  894. they will loaded extremely low in the heap.
  895.  
  896. Because of this second feature, it's not a real good idea to get rid of
  897. preloaded resources.  It's inefficient to have free memory mingled with
  898. a bunch of pointers and locked handles, which is usually what occupies
  899. the lower heap locations.  So no, you probably don't want them purgeable
  900. as well;  you may want to lock them, in fact.
  901.  
  902. To answer your first question:  the Resource Mananger will always do the
  903. Right Thing--it will use a memory-resident copy if it can, and load a
  904. copy from disk if it must.  Preloading doesn't affect this.
  905. - -- 
  906.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  907.  Ceci n'est pas une .signature.
  908.  
  909. +++++++++++++++++++++++++++
  910.  
  911. From: nerm@apple.com (Dean Yu)
  912. Date: 13 May 92 17:09:25 GMT
  913. Organization: Apple Computer, Inc.
  914.  
  915. In article <1992Apr29.151923.472@galaxy.gov.bc.ca>, cconstantine@galaxy.gov.bc.ca writes:
  916. > I don't know if this is an FAQ (I don't think it is) but I was wandering
  917. > how much I would benefit from PreLoaded resources.  
  918. > For example: I have some PICT resources and some CURS resources that I usually
  919. > have set to "pugeable" for memory reasons.  This was recomended by
  920. > someone/where I read.  anyway, in a program where you access these resources
  921. > through resource ID's, do the routines access the resource fork anyway, thus
  922. > bypassing the fact that they _may_ be 'preloaded' or do they check if they are
  923. > in memory first?
  924. > Also, if you have 'preload'd resources, shoud you also have the purgeable flag
  925. > set or is this stupid??
  926. > I hope I'm clear enough on this.  Any help is muchly appreciated!!
  927.  
  928.   I believe the original intent of preloaded resources was to get them in
  929. memory right away, so that the user would not suffer from a disk access
  930. (remember, we're talking about 400K floppies here) during his session.
  931. Preloaded resources are loaded very soon after the application heap is
  932. created, so the rest of the program probably hasn't loaded yet.  Put the disk
  933. access with the rest of the disk access.
  934.   These days, with 5000 meg, 3 nanosecond access time hard drives, preloaded
  935. resources don't make a lot of sense in this regard.  However, this mechanism
  936. is still really useful to help with heap fragmentation.  If you also set the
  937. locked bit on preloaded resources, they get loaded as low in the heap as
  938. possible.  If you have resources that tend to stay in memory for the entire
  939. time your application is running, you might want to think about this to help
  940. manage your memory.
  941.   You should set the purgeable bit on resources that aren't used that frequently,
  942. so it doesn't matter if they go away when you're running low on memory.  For
  943. example, in System Software, all the 'PACK' resources are purgeable, since they're
  944. only used every once in a while, and it's pointless to have them using system heap
  945. memory when that memory can be used for something else.  If you keep the handle to
  946. purgeable resources cached, though, remember to call LoadResource to make sure the
  947. resource is in memory before you start using it.
  948.   So the long and short of it is, having a preloaded, purgeable resource doesn't
  949. make a whole lot of sense these days, but then again, you might have a really good
  950. reason to want to do this that I can't see with my rainbow colored tunnel vision.
  951.  
  952.   -- Dean Yu
  953.      Blue Meanie, Negative Ethnic Role Model, Window Cleaner,
  954.       Skanky Hack Consultant, etc.
  955.      Apple Computer, Inc.
  956.      Wondering why I'm in the office when I could be at the WWDC...
  957.  
  958. ---------------------------
  959.  
  960. From: steve.herman%express@freedom.msfc.nasa.gov (Steve Herman)
  961. Subject: 'STR ' resource question
  962. Organization: Boeing Computer Support Services (BCSS)
  963. Date: Thu, 14 May 1992 15:37:48 GMT
  964.  
  965.     Excuse me in advance if this is a FAQ but...
  966.  
  967.     Just out of curiosity, what is the DATA field of an 'STR ' resource type 
  968. used for.  Is it just for whatever suits your fancy?  If so, what are some 
  969. examples of it's use?
  970.  
  971. Thanks,
  972. Steve 
  973.  
  974.  
  975. - -------------------------------------
  976. Steve Herman - BCSS
  977. "Happiness is just a 'Flaming Moe' away"
  978.     - Moe the Bartender
  979. - -------------------------------------
  980.  
  981. +++++++++++++++++++++++++++
  982.  
  983. From: keith@taligent.com (Keith Rollin)
  984. Date: 15 May 92 01:32:56 GMT
  985. Organization: Taligent
  986.  
  987. In article <1992May14.153748.12024@lambda.msfc.nasa.gov>,
  988. steve.herman%express@freedom.msfc.nasa.gov (Steve Herman) writes:
  989. >     Just out of curiosity, what is the DATA field of an 'STR ' resource type 
  990. > used for.  Is it just for whatever suits your fancy?  If so, what are some 
  991. > examples of it's use?
  992.  
  993. I guess you are seeing this DATA field in ResEdit? I believe that the DATA field
  994. is there simply to show any data that comes after the string. In a perfect
  995. world, a 'STR ' resource simply holds a length byte followed by that many
  996. characters. However, if ResEdit finds extra bytes after the string, it will show
  997. them in the DATA field. They shouldn't be there, but ResEdit shows them to you
  998. to indicate that something might be wrong.
  999.  
  1000. - --
  1001. Keith Rollin
  1002. Phantom Programmer
  1003. Taligent, Inc.
  1004.  
  1005. ---------------------------
  1006.  
  1007. From: nyang@Bonnie.ICS.UCI.EDU
  1008. Subject: How to swab two bytes?
  1009. Date: 14 May 92 23:42:39 GMT
  1010.  
  1011.  
  1012. Hi!
  1013.  
  1014.    I have a problem about swabing two bytes in the memory.  Can someone tell
  1015. me how to do it?  The reason why I need this to be done is because the MS-DOs
  1016. computers store the integer least significant byte first.  So I need to
  1017. convert it to the Mac integer format which is the reverse of LSB.
  1018.  
  1019.    Please don't flame me if this is a stupid question.  Thank you very much
  1020. in advance for any help.
  1021.  
  1022. Nick Yang   nyang@bonnie.ics.uci.edu
  1023.  
  1024. +++++++++++++++++++++++++++
  1025.  
  1026. From: creiman@void.ncsa.uiuc.edu (Charlie Reiman)
  1027. Organization: University of Illinois at Urbana
  1028. Date: Fri, 15 May 1992 18:02:50 GMT
  1029.  
  1030. nyang@Bonnie.ICS.UCI.EDU writes:
  1031.  
  1032.  
  1033. >Hi!
  1034.  
  1035. >   I have a problem about swabing two bytes in the memory.  Can someone tell
  1036. >me how to do it?  The reason why I need this to be done is because the MS-DOs
  1037. >computers store the integer least significant byte first.  So I need to
  1038. >convert it to the Mac integer format which is the reverse of LSB.
  1039.  
  1040. >   Please don't flame me if this is a stupid question.  Thank you very much
  1041. >in advance for any help.
  1042.  
  1043. Okay, I'll just ridicule you a little bit.
  1044.  
  1045. 1) Get some tweezers. Bytes are very small; you'll need something to hold
  1046. onto them with while your swabbing them.
  1047.  
  1048. 2) Buy some good byte polish. I recommend Uncle Al's Mink Oil Flux Soap.
  1049. It has a nice, fruity smell.
  1050.  
  1051. 3) Remove the bytes, and apply the sopa, using a clean, static free,
  1052. lint free cloth.  Use a circular motion.
  1053.  
  1054. 4) Let the polish dry to a white film, then wipe clean with a second cloth.
  1055.  
  1056. 5) Replace the bytes, and away you go!
  1057.  
  1058. Or, if you are out of soap, you could swap the bytes. This is faster,
  1059. but less fun.
  1060.  
  1061. long swap(long in) {
  1062.     long out;
  1063.     char *inp,*outp;
  1064.  
  1065.     inp=(char *)∈
  1066.     outp=(char *)&outp;
  1067.     
  1068.     outp[0]=inp[3];
  1069.     outp[1]=inp[2];
  1070.     outp[2]=inp[1];
  1071.     outp[3]=inp[0];
  1072.  
  1073.     return out;
  1074.     }
  1075.  
  1076. There are many variants on this theme. Ideally, you would have htonl,
  1077. htons, et al. lying around and you wouldn't have to do all this
  1078. nonsense by hand.
  1079.  
  1080. - -- 
  1081. Charlie Reiman - creiman@ncsa.uiuc.edu
  1082. Have a bajillion brilliant Jobsian lithium licks.
  1083.  
  1084. ---------------------------
  1085.  
  1086. End of C.S.M.P. Digest
  1087. **********************
  1088.